/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "TourSchedule")
@NamedQueries({
    @NamedQuery(name = "TourSchedule.findAll", query = "SELECT t FROM TourSchedule t"),
    @NamedQuery(name = "TourSchedule.findByScheduleID", query = "SELECT t FROM TourSchedule t WHERE t.scheduleID = :scheduleID"),
    @NamedQuery(name = "TourSchedule.findByStartDate", query = "SELECT t FROM TourSchedule t WHERE t.startDate = :startDate"),
    @NamedQuery(name = "TourSchedule.findByEndDate", query = "SELECT t FROM TourSchedule t WHERE t.endDate = :endDate"),
    @NamedQuery(name = "TourSchedule.findByPrice", query = "SELECT t FROM TourSchedule t WHERE t.price = :price"),
    @NamedQuery(name = "TourSchedule.findByMinAmount", query = "SELECT t FROM TourSchedule t WHERE t.minAmount = :minAmount"),
    @NamedQuery(name = "TourSchedule.findByMaxAmount", query = "SELECT t FROM TourSchedule t WHERE t.maxAmount = :maxAmount"),
    @NamedQuery(name = "TourSchedule.findByIsAllowed", query = "SELECT t FROM TourSchedule t WHERE t.isAllowed = :isAllowed")})
public class TourSchedule implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "scheduleID")
    private Integer scheduleID;
    @Column(name = "startDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startDate;
    @Column(name = "endDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endDate;
    @Column(name = "price")
    private BigDecimal price;
    @Column(name = "minAmount")
    private Integer minAmount;
    @Column(name = "maxAmount")
    private Integer maxAmount;
    @Column(name = "isAllowed")
    private Boolean isAllowed;
    @JoinColumn(name = "tourID", referencedColumnName = "tourID")
    @ManyToOne(optional = false)
    private TourPack tourPack;
    @OneToMany(mappedBy = "tourSchedule")
    private List<TourBooking> tourBookingList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tourSchedule")
    private List<Routing> routingList;

    public TourSchedule() {
    }

    public TourSchedule(Integer scheduleID) {
        this.scheduleID = scheduleID;
    }

    public Integer getScheduleID() {
        return scheduleID;
    }

    public void setScheduleID(Integer scheduleID) {
        this.scheduleID = scheduleID;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getMinAmount() {
        return minAmount;
    }

    public void setMinAmount(Integer minAmount) {
        this.minAmount = minAmount;
    }

    public Integer getMaxAmount() {
        return maxAmount;
    }

    public void setMaxAmount(Integer maxAmount) {
        this.maxAmount = maxAmount;
    }

    public Boolean getIsAllowed() {
        return isAllowed;
    }

    public void setIsAllowed(Boolean isAllowed) {
        this.isAllowed = isAllowed;
    }

    public TourPack getTourPack() {
        return tourPack;
    }

    public void setTourPack(TourPack tourPack) {
        this.tourPack = tourPack;
    }

    public List<TourBooking> getTourBookingList() {
        return tourBookingList;
    }

    public void setTourBookingList(List<TourBooking> tourBookingList) {
        this.tourBookingList = tourBookingList;
    }

    public List<Routing> getRoutingList() {
        return routingList;
    }

    public void setRoutingList(List<Routing> routingList) {
        this.routingList = routingList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scheduleID != null ? scheduleID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TourSchedule)) {
            return false;
        }
        TourSchedule other = (TourSchedule) object;
        if ((this.scheduleID == null && other.scheduleID != null) || (this.scheduleID != null && !this.scheduleID.equals(other.scheduleID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.TourSchedule[scheduleID=" + scheduleID + "]";
    }

}
